package com.csst.action;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;

import com.csst.bean.Customer;
import com.csst.service.CustomerService;
import com.opensymphony.xwork2.ActionContext;

@Controller
public class CustomerAction {
	private CustomerService service;
	
	public CustomerService getService() {
		return service;
	}

	@Resource
	public void setService(CustomerService service) {
		this.service = service;
	}

	public String list(){
		List<Customer> list=service.list1();
		ActionContext context=ActionContext.getContext();
		context.put("customers", list);
		for (Customer customer : list) {
			System.out.println(customer);
		}
		return "list";
	}

}
